import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/iam/authorize/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data
  })
}

export function getCaptchaCode() {
  return request({
    url: '/captchaImage'
  })
}

export function getInfo(token) {
  return request({
    url: '/iam/user/getInfo',
    method: 'get'
    // params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

export function getUserList(params) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: params
  })
}

export function getUserOfId(id) {
  return request({
    url: '/vue-admin-template/user/' + id,
    method: 'get'
  })
}

export function saveUser(data) {
  return request({
    url: '/vue-admin-template/user',
    method: 'put',
    data
  })
}
